package com.yichen.rent.controller;

import com.yichen.rent.pojo.Message;
import com.yichen.rent.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("message")
@CrossOrigin
public class MessageController {

    @Autowired
    private MessageService messageService;

    /**
     * 拉取消息列表
     * *
     *
     * @param fromId
     * @param toId
     * @return
     */
    @GetMapping
    public List<Message> queryMessageList(@RequestParam("fromId") String fromId, @RequestParam("toId") String toId) {
        return this.messageService.queryMessageList(fromId, toId);
    }
}